package com.music.genres.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.music.domain.CateMusic;
import com.music.genres.dao.FindCateMusicDao;

@Repository
public class FindCateMusicDaoImpl implements FindCateMusicDao {
	@Autowired
	SessionFactory sessionFactory;
	
	@Override
	public List<CateMusic> findCateMusic() {
		String hql="from CateMusic";
		Query query = sessionFactory.getCurrentSession().createQuery(hql);
		List<CateMusic> data = query.list();
		return data;
	}

}
